{include file="public/header"}
{load href="/public/static/Content/ThemesBusiness/ListPage.css"}
<style>
    .datagrid-view {
        overflow-x: scroll;
    }
</style>
<script src="/public/static/Scripts/common-binder-list-view.js"></script>
<script src="/public/static/Scripts/ScriptsEasyui/datagrid-filter.js"></script>

<script type="text/javascript">

    var data = null;
    var gridListHandler = new listGridHandler(data, 'gridListHandler', 'gridList');
    gridListHandler.formName = '管理员';
    gridListHandler.enableFilter = false;
    $(function () {
        gridListHandler.bindFilter($('#gridList'));
    });

    function ShowNew() {
        $.messager.confirm('提示', '备份数据的时间较长，确定要备份所有数据吗?', function (r) {
            if (r) {
                $.ajax({
                    type: "POST",
                    url: '/admin/backup/index.html?type=backup',
                })
                    .success(function (result) {
                        console.log(result);
                        $.messager.alert('错误', "备份成功", 'info');
                       // window.location.reload();
                    })
                    .error(function (result) {
                        $.messager.alert('错误', "备份失败", 'error');
                    });
            }
        });
      
    }


   

  

   

   

    function formatAction(val, row, index) {

        val = '<a href="#" style="color:#1024EE;"   title="下载" onclick="xz(' + row.id + ')">下载</a>' +
            '&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="#" style="color:#1024EE;"  title="还原" onclick="hy(' + row.id + ')">还原</a>' +
            '&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="#" style="color:#1024EE;" title="删除" onclick="del(' + row.id + ')">删除</a>';

        return val;

    }
  

</script>



<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'north',border:false" class="grid-toolbar-panel" id="gridList_ToolBar">

        <a href="#" id="new" onclick="ShowNew()" class="easyui-linkbutton grid-toolbar-button"
            data-options="iconCls:'icon-add'" title="添加备份">添加备份</a>
     
    </div>
    <div data-options="region:'center',border:false">
        <table class="easyui-datagrid"  data-options="pagination:true,pageSize:15,pageList:[10,15,20],multiSort:true,remoteSort:true,striped:true,fit:true,fitColumns:true,rownumbers:true,idField:'_ID',singleSelect: true">
            <thead>
                <tr>
                    {eq name="is_operate" value="true"}
                    <th data-options="field:'id',formatter:formatAction,width:120,halign:'center',align:'center',filterable:false">操作</th>
                    {/eq}
                    <th data-options="field:'username',halign:'center',align:'left',width:120,filterable:false">备份名称
                    </th>
                    <th data-options="field:'realname',halign:'center',align:'left',width:120,filterable:false"><span
                            class="grid-header-sortable">备份时间</span></th>
                    <th data-options="field:'company_name',halign:'center',align:'left',width:120,filterable:false">
                        <span class="grid-header-sortable">备份大小</span></th>
                </tr>
            </thead>
            <tbody>
                {volist name="list" id="vo"}
                <tr>
                    <td>001</td> <td>{$vo.name}</td><td>{$vo.time}</td><td>{$vo.size}</td>
                </tr>
                {/volist}
              
             
            </tbody>
        </table>
      
    </div>
   
</div>

{include file="public/footer"/}